﻿Ext.define("Menu", {
    extend: "Ext.data.Model",
    fields: [
        "Id",
        { name: "OrderIndex", type: "int" },
        "Url",
    //"ShowForm",
        "Image",
        { name: "Value", type: "int" },
        "Name",
        "ModuleID"
             ],
    idProperty: "Id"
});

Ext.define("SHApp.Menu.Form", {
    extend: "BLBTSystem.Form",
    submitUrl: "api/function?format=json",
    winWidth: 400,
    winHeight: 300,
    layout: { type: "vbox", align: "stretch" },
    txtModuleID: "txtModule",
    initComponent: function () {
        var me = this;
        Ext.apply(this);
        
        me.createItems();
        this.callParent(arguments);
    },
    fieldDefaults: {
        labelWidth: 60, //设置标签的样式
        msgTarget: "side", //错误信息显示的位置
        labelSeparator: ":",
        labelAlign: "right",
        border: false,
        anchor: "0"//调节字段的跨度，0表示铺面
    },
    createItems: function () {
        var me = this;
        me.items = [
        {
            xtype: "textfield",
            name: "Id",
            hidden: true
        }, {
            xtype: "numberfield",
            fieldLabel: "排列序号",
            name: "OrderIndex",
            allowBlank: false,
            blankText: "请输入排列序号"
        }, {
            xtype: "textfield",
            name: "ModuleID",
            hidden: true
        }, {
            xtype: "textfield",
            fieldLabel: "菜单名称",
            name: "Name",
            allowBlank: false,
            blankText: "请输入菜单名称"
        }, {
            xtype: "textfield",
            fieldLabel: "Url",
            name: "Url",
            allowBlank: false,
            blankText: "请输入路径"
        }, {
            xtype: "textfield",
            fieldLabel: "图标",
            name: "Image"
        }, {
            xtype: "numberfield",
            fieldLabel: "权限值",
            hidden: true,
            name: "Value",
            readOnly: true
        }
      ]
    }
});